﻿// StudyEXP.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 综合实例 银行账户

#include <iostream>
#include "Account.h"
#include "Date.h"
using namespace std;

int main()
{

	Date date(2008, 11, 1);
	Account accounts[] = {
	Account(date,"03755217",0.015),Account(date,"02342342",0.015) };

	const int n = sizeof(accounts) / sizeof(Account);
	accounts[0].deposit(Date(2008, 11, 5), 5000, "salary");
	accounts[1].deposit(Date(2008, 11, 25), 10000, "sell stock 0323");

	accounts[0].deposit(Date(2008, 12, 5), 5500, "salary");
	accounts[1].withdraw(Date(2008, 12, 20), 4000, "buy a laptop");

	cout << endl;
	for (int i = 0; i < n; ++i)
	{
		accounts[i].settle(Date(2009, 1, 1));
		accounts[i].show();
		cout << endl;

	}
	cout << "Total:" << Account::getTotal() << endl;
	return 0;

}


